//
//  HFApplication.m
//  HocusFocus
//
//  Created by Juan Carlos Jimenez on 4/1/06.
//  Copyright 2008 Juan Carlos Jimenez. All rights reserved.
//
#import "HFApplication.h"
#import "HFCaptureWindowController.h"

// NSEvent subtypes for hotkey events (undocumented).
enum {
	kEventHotKeyPressedSubtype = 6,
	kEventHotKeyReleasedSubtype = 9,
};

NSString *rectToString(NSRect rect)
{
    return [NSString stringWithFormat:@"{ %f, %f, %f, %f }", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height];
}

NSString *sizeToString(NSSize size)
{
    return [NSString stringWithFormat:@"{ %f, %f }", size.width, size.height];
}

@implementation HFApplication

- (void)sendEvent:(NSEvent *)event
{
	if ([event type] == NSSystemDefined && [event subtype] == kEventHotKeyPressedSubtype) {
		[captureWindowController handleHotKey:event];
	}
    // YOU MUST CALL THIS OR YOU WILL EAT EVENTS!
	[super sendEvent:event];
}

@end
